import { Component, OnInit } from "@angular/core";
import { Test02Service } from "./test02.service";

@Component({
  selector: "app-test02",
  templateUrl: "./test02.component.html",
  styleUrls: ['../style.css',"./test02.component.css"]
})
export class Test02Component implements OnInit {
  lst: string[];
  constructor(private service: Test02Service) {}

  ngOnInit() {
    this.lst = this.service.getlst();
  }

  add(s: string) {
    this.service.add(s);
  }
  reload() {
    this.lst = this.service.getlst();
  }
}
